Learn R Programming

Rfast (version 1.7.3)

minimum and maximum : Minimum and maximum of a vector

Description

Minimum and maximum of a vector.

Usage

min_max(x,index=FALSE)

Arguments

x
A numerical vector with data.
index
A boolean value for the indices fo the minimum and the maximum value.

Value

A vector with the relevant values, min and max.

See Also

rowMins, rowMaxs, nth, colrange, colMedians,sort_mat

Examples

Run this code
x <- rnorm(1000 * 2000)

system.time( s1 <- min_max(x) )
system.time( s2 <- c(min(x), max(x)) )

Run the code above in your browser using DataLab